package org.linlinjava.litemall.db.service;

import java.time.LocalDateTime;
import java.util.List;

import javax.annotation.Resource;

import org.linlinjava.litemall.db.dao.LitemallSettlementLogMapper;
import org.linlinjava.litemall.db.domain.LitemallSettlementLog;
import org.linlinjava.litemall.db.domain.LitemallSettlementLogExample;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;


@Service
public class LitemallSettlementLogService {
    @Resource
    private LitemallSettlementLogMapper settlementLogMapper;

    public void deleteById(Integer id) {
        settlementLogMapper.logicalDeleteByPrimaryKey(id);
    }

    public void add(LitemallSettlementLog log) {
        log.setAddTime(LocalDateTime.now());
        log.setUpdateTime(LocalDateTime.now());
        settlementLogMapper.insertSelective(log);
    }


    
    public List<LitemallSettlementLog> queryBySettlementId(Integer settlementId) {
    	LitemallSettlementLogExample example = new LitemallSettlementLogExample();
    	example.or().andSettlementIdEqualTo(settlementId).andDeletedEqualTo(false);
    	return settlementLogMapper.selectByExample(example);
    }
}
